﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<QianBuo.Lottery.Web.Models.User.TakeMoney_Mod>" %>


<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	申请提款
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<script type="text/javascript">
    var minTakeMoney = <%=Model.MinTakeMoney %>;
    var maxTakeMoneyCount = <%=Model.MaxTakeMoneyCount%>;
    var takeMoneyCount = <%=Model.TakeMoneyCount%>;
    var balance = <%=Model.Balance %>;
    function btn_Click() {
        if (takeMoneyCount >= maxTakeMoneyCount) {
            alert("您今天已提款"+takeMoneyCount+"次，您不能再提款了。");
            return false;
        }
        var txtTakeMoney = $("#Money")[0];
        var money = parseFloat(txtTakeMoney.value);
        if (money< minTakeMoney) {
            alert("提款金额不能低于最少提款金额，请重新输入!");
            txtTakeMoney.focus();
            return false;
        }
        if (money > balance) {
            alert("您的余额不足本本次提款，请重新输入。");
            txtTakeMoney.focus();
            return false;
        }
        return confirm("您确定要提款吗？");
    }
</script>
    <% using (Html.BeginForm()) {%>
        <%= Html.ValidationSummary(true) %>

        <fieldset>
            <legend>申请提款</legend>
            <%=Html.ValidationMessage("Error") %>
            <ul class="editlist">
                <li><span class="label">
                    <label>您的余额:</label></span><%=Model.Balance %>元</li>
                <li>
                    <span class="label">
                    <%=Html.LabelFor(p=>p.Money) %></span>
                    <%=Html.TextBoxFor(p => p.Money, new { @class = "textbox" })%>元
                    <%=Html.ValidationMessageFor(p=>p.Money,"",new {@class="validation"}) %>
                    <span>
                        (注:每次至少提款<font color='red'><%=Model.MinTakeMoney%></font>元,
                        每天最多提<font color='red'><%=Model.MaxTakeMoneyCount%></font>次,
                        您已经提款<font color='red'><%=Model.TakeMoneyCount%></font>次)
                    </span>
                </li>
                <li><span class="label">收款账号:</span> <span>
                    <%=Html.DropDownListFor(p => p.Type, Model.Types.Where(p=>p.Value==Code.Models.BankType.Bank.ToString())) %>
                </span></li>
                <li>
                    <span class="label">
                    <%=Html.LabelFor(p=>p.TakePwd) %></span>
                    <input type="password" class="textbox" id="TakePwd" name="TakePwd" />
                    <%=Html.ValidationMessageFor(p=>p.TakePwd,"",new {@class="validation"}) %>(默认为123456)
                </li>
                <li>
                    <span class="label">
                    <%=Html.LabelFor(p=>p.Msg) %></span>
                    <%=Html.TextAreaFor(p => p.Msg, 4, 50, new {})%>
                </li>
                <li class="btn">
                    <input type="submit" value="确认提款" onclick="return btn_Click()" />
                </li>
            </ul>
        </fieldset>
    <% } %>


</asp:Content>
